<template>
  <div id="top">
    <div class="nav">
      <router-link to="" tag="div">
        <img src="/static/img/may_1.png" alt="">
      </router-link>
      <nav>
        <router-link to="/" active-class="active" exact>首页</router-link>
        <router-link to="/fenl" active-class="active">分类</router-link>
        <router-link to="/shi" active-class="active">食材</router-link>
        <router-link to="/ping" active-class="active">视频</router-link>
      </nav>
      <router-link to="" tag="div">
        <img src="/static/img/may_2.png" alt="">
        <span>发菜谱</span>
      </router-link>
    </div>
    <div id="view">
      <router-view></router-view>
    </div>

  </div>
</template>

<script>
export default {
  linkActiveClass: "active",
  name: "Recipe",
  data: () => ({})
};
</script>

<style lang="scss">
#top {
  width: 100%;
  height: 100%;
  flex-grow: 1;
  flex-direction: column;
  .nav {
    width: 100%;
    height: 2.5rem;
    display: flex;
    background: #ff6767;
    align-items: center;
    > div {
      width: 2.5rem;
      text-align: center;
      &:nth-child(1) {
        > img {
          width: 50%;
        }
      }
      &:nth-child(3) {
        color: white;
        > img {
          width: 30%;
        }
        > span {
          display: block;
          font-size: 12px;
        }
      }
    }
    > nav {
      // width: 100%;
      flex-grow: 1;
      height: 2.5rem;
      display: flex;
      justify-content: space-around;
      align-items: center;
      .active {
        font-size: 1rem;
        // color: #000;
      }
      > a {
        display: block;
        flex-grow: 1;
        // height: 100%;
        text-align: center;
        color: white;
      }
    }
  }

  #view {
    width: 100%;
    // flex-grow: 1;
    height: calc(100% - 2.5rem);
    overflow: hidden;
  }
}
</style>
